<!DOCTYPE html>
<!--suppress ALL -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>酒店详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/travelContent.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/editTravels.css"/>
    <link rel="stylesheet" href="/css/strategy.css" />
    <script src="js/common.js"></script>
    <link rel="stylesheet" href="js/plugins/dialog2/dialog.css">
    <script src="js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/css/login.css" >
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="js/plugins/jquery-form/jquery.form.js"></script>


</head>
<body>
<div class="nav-search">
    <a href="/hotelInquirePage.html">
        <span>
            <a href="/hotelInquirePage.html"><h3><</h3></a>
        </span>
    </a>
</div>
    <div class="all">


        <form class="form-signin" id="hoteForm" method="post" action="/hotelDetail/likeCount" >
            <!--<#list hotelDetails as h>-->
            <input type="hidden"  name="hotelid" id="hotelParameterId" value="" >
        <!--</#list>-->
            <input type="hidden"  name="userid" id="userParameterId" value="" >
        </form>


        <div class="container d-flex">
            <div class="p-2  flex-fill" id="like123456781852">
                <i class="fa fa-thumbs-o-up"  id="likeBtn"> </i><h8 id="showLike" render-html="like"></h8>
            </div>
            <div class="p-2  flex-fill"><i class="fa  fa-commenting-o"  id="commentBtn"> </i>
            </div>
            <div class="p-2  flex-fill"><i class="fa fa-star-o" id="collectBtn"> </i>
            </div>
        </div>
    </div>

</body>
</html>
<script>
    $(function () {


        var params = getParams();
        if (params.id) {
            $.get("/hotelDetail/"+params.id,function (data) {
                $("#hoteForm").after(data);


                //先接收共享过来的用户数据
                var userStr = sessionStorage.getItem("user")
                var user = JSON.parse(userStr);
                $("#userParameterId").val(user.id);
                //拿到酒店的id,回显到表单
                $("#hotelParameterId").val(params.id);

                //在页面加载完毕的时候将酒店点赞总数查询出来
                $.get("/hotelDetail/"+params.id+"/like",function (data) {
                    $("#like123456781852").renderValues({like:data})
                })


                $("#likeBtn").on("click",function () {
                    $("#hoteForm").ajaxSubmit(function (data) {
                            /*$("#like123456781852").css({"color": "red"});*/
                            $("#like123456781852").renderValues({like:data})
                    })
                });

                //获取浏览量
                $.get("/hotelDetail/pageview",{uid:user.id,hid:params.id},function (data) {

                })

            },"html")
        }





    })
</script>
